import { apiConfig } from './util/apiConfig.js'
import { request } from './util/request.js'

//获取商品
export function getGoods(page = 1, catname_flag = 'tab_hpzc'){
	const data = Object.assign({}, apiConfig.params, {
		page: page, 
		app_version: '',
		catname: catname_flag,
		flag: catname_flag
	})
	return request.get(apiConfig.apiUrl + 'getGoods', data)
}

//获取专场列表
export function getBrandGoods(brand_id, page = 1, msort = 1) {
	const data = {
		page: page,
		brand_id: brand_id,
		msort: msort,
		goods_utype: 'C4',
		price_range: '',
		cat_threeids: ''
	}
	return request.get(apiConfig.apiUrl + 'getBrandGoods', data)
}

//获取商品详细信息
export function getMemberAboutInfo(goods_id, sa_id, is_pt_goods, req_coupons_id){
	const data = Object.assign({}, apiConfig.params, {
		goods_id: goods_id,
		sa_id: sa_id,
		is_pt_goods: is_pt_goods,
		req_coupons_id: req_coupons_id
	})
	return request.get(apiConfig.apiUrl + 'getMemberAboutInfo', data)
}
